package com.ibangnuo.manage.controller.newLandpay;

import com.ibangnuo.api.newLandpay.MerchantsIntoPiecesControllerApi;
import com.ibangnuo.framework.domain.ext.CommercialTenantDetailsExt;
import com.ibangnuo.framework.model.response.ObjectResult;
import com.ibangnuo.manage.service.newLandpay.MerchantsIntoPiecesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @Author: wwy
 * @Date: 2020-01-10 9:55
 */
@RestController
@RequestMapping("/newLandIntoPieces")
public class MerchantsIntoPiecesController implements MerchantsIntoPiecesControllerApi {
    @Autowired
    private MerchantsIntoPiecesService merchantsIntoPiecesService;

    /**
     * 商户进件
     * @param id
     * @return
     */
    @GetMapping("/mercRegist/{id}")
    @Override
    public ObjectResult mercRegist(@PathVariable("id") String id) {
        return merchantsIntoPiecesService.mercRegist(id);
    }

    @PostMapping("/submit")
    @Override
    public ObjectResult mercSubmit(@RequestBody Map<String, String> map) {
        return null;
    }

    @PostMapping("/search/{id}")
    @Override
    public ObjectResult mercSearch(@PathVariable("id") String id) {
        return merchantsIntoPiecesService.mercSearch(id);
    }

    /**
     * 查询mcc
     * @return
     */
    @GetMapping("/mCCSearch")
    @Override
    public ObjectResult mCCSearch() {
        return merchantsIntoPiecesService.mCCSearch();
    }

    /**
     * 查询areaCode值
     * @return
     */
    @GetMapping("/areaCode")
    @Override
    public ObjectResult areaCode() {
        return merchantsIntoPiecesService.areaCode();
    }

    /**
     * 依据code省市区查询
     * @param code
     * @return
     */
    @GetMapping("/findPcaByCode/{code}")
    @Override
    public ObjectResult findPcaByCode(@PathVariable("code") String code) {
        return merchantsIntoPiecesService.findPcaByCode(code);
    }

    /**
     * 依据code查询mcc
     * @param code
     * @return
     */
    @GetMapping("/findMccByCode/{code}")
    @Override
    public ObjectResult findMccByCode(@PathVariable("code") String code) {
        return merchantsIntoPiecesService.findMccByCode(code);
    }
}
